﻿using ActiveStoryTouch.DataModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestSuite.DataModel
{
    
    
    /// <summary>
    ///This is a test class for CanvasSettingsTest and is intended
    ///to contain all CanvasSettingsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class CanvasSettingsTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for CanvasSettings Constructor
        ///</summary>
        [TestMethod()]
        public void CanvasSettingsConstructorTest()
        {
            CanvasSettings target = new CanvasSettings();
            Assert.AreEqual<int>(0, target.Alpha);
            Assert.AreEqual<int>(255, target.Red);
            Assert.AreEqual<int>(255, target.Green);
            Assert.AreEqual<int>(255, target.Blue);
            Assert.AreEqual<float>(1024, target.Width);
            Assert.AreEqual<float>(768, target.Height);

        }

        /// <summary>
        ///A test for Alpha
        ///</summary>
        [TestMethod()]
        public void AlphaTest()
        {
            CanvasSettings target = new CanvasSettings();
            int expected = 0;
            int actual;
            target.Alpha = expected;
            actual = target.Alpha;
            Assert.AreEqual(expected, actual);

            target.Alpha = 300;
            actual = target.Alpha;
            Assert.AreEqual(expected, actual);

            target.Alpha = -1;
            actual = target.Alpha;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Blue
        ///</summary>
        [TestMethod()]
        public void BlueTest()
        {
            CanvasSettings target = new CanvasSettings();
            int expected = 255;
            int actual;
            target.Blue = expected;
            actual = target.Blue;
            Assert.AreEqual(expected, actual);

            target.Blue = 300;
            actual = target.Blue;
            Assert.AreEqual(expected, actual);

            target.Blue = -1;
            actual = target.Blue;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Green
        ///</summary>
        [TestMethod()]
        public void GreenTest()
        {
            CanvasSettings target = new CanvasSettings(); // TODO: Initialize to an appropriate value
            int expected = 255; // TODO: Initialize to an appropriate value
            int actual;
            target.Green = expected;
            actual = target.Green;
            Assert.AreEqual(expected, actual);

            target.Green = 300;
            actual = target.Green;
            Assert.AreEqual(expected, actual);

            target.Green = -1;
            actual = target.Green;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Height
        ///</summary>
        [TestMethod()]
        public void HeightTest()
        {
            CanvasSettings target = new CanvasSettings(); // TODO: Initialize to an appropriate value
            float expected = 768f; // TODO: Initialize to an appropriate value
            float actual;
            target.Height = expected;
            actual = target.Height;
            Assert.AreEqual(expected, actual);

            target.Height = -1;
            actual = target.Height;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Red
        ///</summary>
        [TestMethod()]
        public void RedTest()
        {
            CanvasSettings target = new CanvasSettings();
            int expected = 255;
            int actual;
            target.Red = expected;
            actual = target.Red;
            Assert.AreEqual(expected, actual);

            target.Red = 300;
            actual = target.Red;
            Assert.AreEqual(expected, actual);

            target.Red = -1;
            actual = target.Red;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Width
        ///</summary>
        [TestMethod()]
        public void WidthTest()
        {
            CanvasSettings target = new CanvasSettings();
            float expected = 1024f;
            float actual;
            target.Width = expected;
            actual = target.Width;
            Assert.AreEqual(expected, actual);

            target.Width = -1;
            actual = target.Width;
            Assert.AreEqual(expected, actual);
        }
    }
}
